package com.carkeeper.system.dao;

import com.carkeeper.system.pojo.Employee;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface UserDao extends Mapper<Employee> {
    @Select("select role_id from tb_employee_role where employee_id=#{id}")
    List<Long> findroleIdByemployeeId(Long id);

    //根据username查询password
    @Select("select password from tb_employee where username=#{username}")
    String findPassword(@Param("username") String username);

    //根据username更改password
    @Update("update tb_employee set password=#{newPassword} where username=#{username}")
    void changePassword(@Param("username") String username,@Param("newPassword") String newPassword);
}
